package com.tlsy.commerce.model;

import com.tlsy.commerce.model.converter.RoleTypeConverter;
import com.tlsy.commerce.model.converter.StatusConverter;
import com.tlsy.commerce.model_enum.RoleTypeEnum;
import com.tlsy.commerce.model_enum.StatusEnum;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 角色实体
 * @author Tlsy
 * @version commerce 0.0.1
 * @date 2017/4/13  14:58
 */
@Entity
@Table(name = "role")
@Getter
@Setter
public class Role extends IdEntity{

    private static final long serialVersionUID = 6035462719833235743L;

    @Column(name = "role_type")
    @Convert(converter = RoleTypeConverter.class)
    private RoleTypeEnum type;

    @Column(name = "code")
    private String code;

    @Column(name = "role_status")
    @Convert(converter = StatusConverter.class)
    private StatusEnum status;

    @Column(name = "description",length = 4000)
    private String description;


}
